<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="../static/js/jquery-1.8.2.min.js"></script>
</head>
<body>
<div class="container">
    <div class="navbar">
        <img src="../static/css/img/8abef1f141f6ade658d59ea7147d5d65.jpeg" alt="">
    </div>
    <div align="right">
        <input type="button" value="查看我的砍价列表" class="btn btn-info" id="goOrder">
    </div>
    <table class="table table-striped table-hover table-responsive">
        <tr>
            <td th:width="150px">活动名称</td>
            <td>商品图片</td>
            <td>商品名称</td>
            <td>商品原价</td>
            <td>商品底价</td>
            <td>操作</td>
        </tr>
        <tr th:each="list:${list}">
            <td th:text="${list.bargainingName}"></td>
            <td><img th:src="${list.goodsImg}" alt="" width="100px" height="100px"></td>
            <td th:text="${list.goodsName}"></td>
            <td th:text="${list.goodsPrice}"></td>
            <td th:text="${list.floorPrice}"></td>
            <td><input type="button" value="查看详情" th:onclick="btn([[${list.bargainingId}]])"></td>
        </tr>
    </table>
</div>
</body>
<script>
    function btn(bargainingId) {
        location = "/bargaining/goDetails?bargainingId="+bargainingId;
    }
    $("#goOrder").click(function () {
        $.post(
            "/order/findOrder",
            function (a) {
                if (a==0){
                    alert("您当前还没有选择任何商品");
                }else {
                    location = "/order/goOrder";
                }
            }
        )
    })
</script>
</html>
